package com.ruoyi.archive.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.archive.mapper.SFamilyOfDutySoldierMapper;
import com.ruoyi.archive.domain.SFamilyOfDutySoldier;
import com.ruoyi.archive.service.ISFamilyOfDutySoldierService;

/**
 * 因公牺牲军人遗属信息Service业务层处理
 *
 * @author Allen
 * @date 2021-09-30
 */
@Service
public class SFamilyOfDutySoldierServiceImpl extends ServiceImpl<SFamilyOfDutySoldierMapper, SFamilyOfDutySoldier> implements ISFamilyOfDutySoldierService {
    @Autowired
    private SFamilyOfDutySoldierMapper sFamilyOfDutySoldierMapper;

    /**
     * 查询因公牺牲军人遗属信息
     *
     * @param id
     *         因公牺牲军人遗属信息主键
     *
     * @return 因公牺牲军人遗属信息
     */
    @Override
    public SFamilyOfDutySoldier selectSFamilyOfDutySoldierById(Long id) {
        return sFamilyOfDutySoldierMapper.selectSFamilyOfDutySoldierById(id);
    }

    /**
     * 查询因公牺牲军人遗属信息列表
     *
     * @param sFamilyOfDutySoldier
     *         因公牺牲军人遗属信息
     *
     * @return 因公牺牲军人遗属信息
     */
    @Override
    public List<SFamilyOfDutySoldier> selectSFamilyOfDutySoldierList(SFamilyOfDutySoldier sFamilyOfDutySoldier) {
        return sFamilyOfDutySoldierMapper.selectSFamilyOfDutySoldierList(sFamilyOfDutySoldier);
    }

    /**
     * 新增因公牺牲军人遗属信息
     *
     * @param sFamilyOfDutySoldier
     *         因公牺牲军人遗属信息
     *
     * @return 结果
     */
    @Override
    public int insertSFamilyOfDutySoldier(SFamilyOfDutySoldier sFamilyOfDutySoldier) {
        if (sFamilyOfDutySoldier != null) {
            return sFamilyOfDutySoldierMapper.insertSFamilyOfDutySoldier(sFamilyOfDutySoldier);
        }
        return 0;
    }

    /**
     * 修改因公牺牲军人遗属信息
     *
     * @param sFamilyOfDutySoldier
     *         因公牺牲军人遗属信息
     *
     * @return 结果
     */
    @Override
    public int updateSFamilyOfDutySoldier(SFamilyOfDutySoldier sFamilyOfDutySoldier) {
        return sFamilyOfDutySoldierMapper.updateSFamilyOfDutySoldier(sFamilyOfDutySoldier);
    }

    /**
     * 批量删除因公牺牲军人遗属信息
     *
     * @param ids
     *         需要删除的因公牺牲军人遗属信息主键
     *
     * @return 结果
     */
    @Override
    public int deleteSFamilyOfDutySoldierByIds(Long[] ids) {
        return sFamilyOfDutySoldierMapper.deleteSFamilyOfDutySoldierByIds(ids);
    }

    /**
     * 删除因公牺牲军人遗属信息信息
     *
     * @param id
     *         因公牺牲军人遗属信息主键
     *
     * @return 结果
     */
    @Override
    public int deleteSFamilyOfDutySoldierById(Long id) {
        return sFamilyOfDutySoldierMapper.deleteSFamilyOfDutySoldierById(id);
    }
}
